#include <stdio.h>

int main(int argc, char *argv[])
{
	int n, m, i, j, t, k[5000], s[5000], line, cnt;

	scanf("%d %d", &n, &m);
	for (i=0; i<n; i++) {
		scanf("%d %d", &k[i], &s[i]);
	}

	for (i=0; i<n-1; i++) {
		for (j=i+1; j<n; j++) {
			if (s[i] < s[j]) {
				t = s[i];
				s[i] = s[j];
				s[j] = t;
				t = k[i];
				k[i] = k[j];
				k[j] = t;
			}
		}
	}

	cnt = (int)(m * 1.5);
	line = s[cnt-1];
	while (s[cnt-1] == s[cnt] && cnt < n) {
		cnt++;
	}

	printf("%d %d\n", line, cnt);
	for (i=0; i<cnt; i++) {
		printf("%d %d\n", k[i], s[i]);
	}

	return 0;
}
